<!--{include(file='head.html')}-->
<script type="text/javascript" src="template/jslib/date/WdatePicker.js"></script>
<div id="wrap">
	<!--{include('left.html')}-->
	<div id="maincont">
		<b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b>
		<div id="main_c">
			<form name="seaform" id="seaform" action="<!--{url('admin','sale','index')}-->" method="post" onsubmit="$.oper.checkq('submit')">
			<div class="bt_bk">
				<span class="search_bk">
					从 <input type="text" class="input_tx short" value="<!--{if $time1}--><!--{date('Y-m-d H:i',$time1)}--><!--{/if}-->" name="time1" onclick="WdatePicker()"/>
					到 <input type="text" class="input_tx short" value="<!--{if $time2}--><!--{date('Y-m-d H:i',$time2)}--><!--{/if}-->" name="time2" onclick="WdatePicker()" />
					<select name="qtype" class="select_tx">
						<option value="trade"		<!--{if $qtype == 'trade'}-->selected<!--{/if}-->	>订单</option>
						<option value="item"		<!--{if $qtype == 'item'}-->selected<!--{/if}-->	>商品</option>
						<option value="product"		<!--{if $qtype == 'product'}-->selected<!--{/if}--> >货品</option>
						<option value="user"		<!--{if $qtype == 'user'}-->selected<!--{/if}-->	>会员</option>
					</select>
					<input type="text" class="input_tx <!--{if !$q}-->hintinput<!--{/if}-->" name="q" id="q" value="<!--{def($q,'订单/商品(货号，ID)/货品(货号)/会员(ID)')}-->" onfocus="$.oper.checkq('focus')" onblur="$.oper.checkq('blur')"/>
					<input type="hidden" value="" name="do" id="do"/>
					<input type="button" value="搜索" class="input_bt" onclick="$.oper.seasubmit('sea')"/>
					<input type="button" value="导出" class="input_bt" onclick="$.oper.seasubmit('import')"/>
				</span>
				<span class="state_tip"></span>
				
			</div>
				<input type="hidden" value="1"	name="status" id="status"/>
				<input type="hidden" value="<!--{$pagearr['page']}-->"		name="page" id="page"/>
				<input type="hidden" value="<!--{$pagearr['pagesize']}-->"	name="pagesize" id="pagesize" />
			</form>
			<!--{include_page("page.html","top")}-->
			<table class="tableStyle" border="0" cellspacing="0" cellpadding="0">
				<thead>
					<tr align="center">
						<th width="20%">
						<!--{if $orderby == 'saleid'}-->
						<a href="<!--{url('admin','sale','index','orderby=saleid&order=$orderrev')}-->" class="<!--{$order}-->">时间</a>
						<!--{else}-->
						<a href="<!--{url('admin','sale','index','orderby=saleid&order=desc')}-->">时间</a>
						<!--{/if}-->
						</th>
						<th width="40%" colspan="2">
						<!--{if $orderby == 'itemid'}-->
						<a href="<!--{url('admin','sale','index','orderby=itemid&order=$orderrev')}-->" class="<!--{$order}-->">商品</a>
						<!--{else}-->
						<a href="<!--{url('admin','sale','index','orderby=itemid&order=desc')}-->">商品</a>
						<!--{/if}-->
						</th>
						<th width="10%">
						<!--{if $orderby == 'uid'}-->
						<a href="<!--{url('admin','sale','index','orderby=uid&order=$orderrev')}-->" class="<!--{$order}-->">会员</a>
						<!--{else}-->
						<a href="<!--{url('admin','sale','index','orderby=uid&order=desc')}-->">会员</a>
						<!--{/if}-->
						</th>
						<th width="10%">
						<!--{if $orderby == 'num'}-->
						<a href="<!--{url('admin','sale','index','orderby=num&order=$orderrev')}-->" class="<!--{$order}-->">数量</a>
						<!--{else}-->
						<a href="<!--{url('admin','sale','index','orderby=num&order=desc')}-->">数量</a>
						<!--{/if}-->
						</th>
						<th width="10%">
						<!--{if $orderby == 'price'}-->
						<a href="<!--{url('admin','sale','index','orderby=price&order=$orderrev')}-->" class="<!--{$order}-->">价格(￥)</a>
						<!--{else}-->
						<a href="<!--{url('admin','sale','index','orderby=price&order=desc')}-->">价格(￥)</a>
						<!--{/if}-->
						</th>
						<th width="10%">小计</th>
					</tr>
				</thead>
				<tbody id="listtbody">
					<!--{foreach $sales sale}-->
					<tr align="center" id="tr_<!--{$sale.saleid}-->">
						<td align="left">
							购买：<!--{date("m-d",$sale.saletime)}--> <br />
							成交：<!--{date("m-d",$sale.finishtime)}--><br />
							订单：<!--{$sale.tradeid}-->
						</td>
						<td align="left" width="5%">
							<a href="<!--{url('index','item','index','itemid=$sale[itemid]')}-->" target="_blank">
								<img src = "<!--{$sale.itemimg}-->_50x50.jpg" width="50" height="50" onerror="this.onerror='',this.src='images/nopicture.jpg'" class="mid"/>
							</a>
						</td>
						<td align="left" width="35%">
							<!--{$sale.itemname}--><br />
							商品编号：<!--{$sale.ibn}--><!--{if $sale.pbn}-->，货品编号：<!--{$sale.pbn}--><!--{/if}-->
						</td>
						<td>
							<!--{$sale.uid}--> / <!--{$sale.uname}-->
						</td>
						<td>
							<!--{$sale.num}-->
						</td>
						<td><!--{getPrice($sale[price])}--></td>
						<td><!--{getPrice($sale[price] * $sale[num])}--></td>
					</tr>
					<!--{/foreach}-->
				</tbody>
			</table>
			<!--{include_page("page.html","foot")}-->
		</div>
		<b class="b4b"></b><b class="b3b"></b><b class="b2b"></b><b class="b1b"></b>
	</div>
</div>
<!--{include(file='foot.html')}-->
<script type="text/javascript">
$(function(){
	$.oper.setdefq('订单/商品(货号，ID)/货品(货号)/会员(ID)');
});
</script>